package org.llc.flink.wordcount

/**
 * 原生api实现
 */
object Scala {
  def main(args: Array[String]): Unit = {
    val array = Array("good good study", "day day up")

    array
      .flatMap(_.split(" "))
      .map((_, 1))
      .groupBy(_._1)
      .mapValues(_.foldLeft(0)(_ + _._2))
      .foreach(println(_))
  }
}
